package My

import (
	"fmt"
	"reflect"
)

func structPropertyTypeMap(i map[string]any, s any) (r map[string]reflect.Kind, err error) {
	objType := reflect.TypeOf(s)
	if objType.Kind() != reflect.Struct {
		return nil, fmt.Errorf("obj must be a struct or a pointer to struct")
	}
	result := make(map[string]reflect.Kind)
	for q := 0; q < objType.NumField(); q++ {
		field := objType.Field(q)
		tag := field.Tag.Get("json")
		if tag == "" || tag == "-" {
			continue
		}
		result[tag] = field.Type.Kind()
	}
	return
}
